home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / BLAKJACK.PAK / READ.TXT < prev    next >
Text File  |  1997-05-06  |  5KB  |  117 lines

  1. This is a subset of a standard blackjack game. It uses a card VBX control
  2. to display the cards.
  3.  
  4. Objective: One player and one dealer can play this game.
  5.               The player enters amount of money
  6.               using the "Bankroll" button at the begining of the game.
  7.               After entering the bankroll amount, the player can go on
  8.               pressing "Hit" button until the score is near 21.
  9.               If the player scores more than 21, he looses.
  10.               The trick is to hit "Stand" button when the score is near 21.
  11.               After you loose or win, you can bet again using the "Bet" button.
  12.               Player plays the game until the bankroll is exhausted,
  13.               at that time he can input more money in bankroll.
  14.  
  15.  
  16. Buttons   Explanation
  17. -------------------------------------------------------------------------------
  18.  
  19. Bankroll- Hit this button and enter the amount you want to play (Max 9999)
  20.  
  21. Bet     - Hit this button when you want to bet part of the money from
  22.              bankroll. No letters, negative numbers are allowed in the
  23.              input dialog, it will not accept the input at all.
  24.  
  25. Play    - After you hit the bet button it toggles to a 'Play' button.
  26.              Pressing this button starts the game.
  27.              At start, immediately after betting, the player and the dealer are
  28.              issued 2 cards. If any one of these hand add up to 21 the party
  29.              wins immediately. If both are 21, the game is draw.
  30.              Dealer shows only one card face up all the time, along with the
  31.              points.
  32.  
  33. Hit      -Player receives one card from dealer when he hits this button. The
  34.              issued card is immediately displayed with the new total points.
  35.              At this point dealer may choose a card if his total point is less
  36.              than 17, which is not displayed as usual(dealers algorithm to hit
  37.              a card).
  38.  
  39. Stand    -This button is hit when the player no longer wishes to play.
  40.              At this point dealer may deal a card to himself if his points are
  41.              less than 17. At the end dealers hand is displayed and the scores
  42.              are announced.
  43.  
  44. Help:      Shows help|About dialog.
  45.  
  46. // Design Overview:
  47. // -----------------
  48. //
  49. // Classes:
  50. // ------------
  51. // There are 2 cpp files blakjack.cpp and owlmain.cpp
  52. // blakjack.cpp - contains the engine for the game.
  53. // owlmain.cpp  - contains the windows user interface.
  54. // blakjack.h   - contains the class declarations for the engine.
  55. // owlmain.h    - contains the class declaration for GUI interface.
  56. // blakjack.rc  - contains the dialog resources and card resources(VBX control)
  57.  
  58. // Following objects(classes) are used in this program.
  59. // These are declared in blakjack.h
  60. // card - The card object.
  61. // deck (is implemented in terms of cards, 52)
  62. // hand - state of a player, cards, points etc.
  63. // dealer:public hand
  64. // player:public hand
  65. // bankroll - amount of money
  66. // blackjack - the game.
  67. //
  68. // The following classes are defined in owlmain.h
  69. // These are used to implement the User Interface.
  70. //
  71. // TBlackjackFrame - Used to move the frame window, in SetupWindow())
  72. // TBlackjack - This is the dialog which displays all the buttons and
  73. //              the cards.
  74. // TBlackjackApp - The standard OWL application object.
  75. // MovableDialog - Is used to move the about box.
  76.  
  77. // General Concepts:
  78. // -----------------
  79. // First the Bankroll is entered by the user and stored in the "Bankroll"
  80. // class. The increment and decrement of the bankroll is done by the
  81. // member funtions in that class.
  82.  
  83. // 52 cards are "new"-ed  of type "TVbxMhCardDeck" and stored in  the
  84. // array "TBlackjack::ppVBXCard[]" in the constructor of
  85. // "TBlackjack" class.
  86. // "TVbxMhCardDeck" type of cards are VBX controls.
  87. // The "Card" object stores only the Suit and Number information.
  88. // ("Card" object is defined in blakjack.h)
  89.  
  90. // When a "Card" is displayed the Suit and Number informations are
  91. // taken from the "Card" object, the displayable VBX card is taken from
  92. // "TBlackjack::ppVBXCard[VBXCardCount]" array. Each VBX card can have 52
  93. // possible values. The VBX card is displayed according to the
  94. // above Suit and Number information.
  95.  
  96. // "TBlackjack::VBXCardCount", points to the next VBX card in the
  97. // "TBlackjack::ppVBXCard[]" array which is available.
  98. // eg: Count 12 means, cards from ppVBXCard[0] through ppVBXCard[11]
  99. // have already been dealt and displayed, and ppVBXCard[12] is
  100. // the next VBX card available.
  101.  
  102. // Suffling and dealing are done using "Card" and "Deck"
  103. // objects. "TBlackjack::ppVBXCard[]" array only holds the
  104. // displayable VBX cards. Each "Card" object stores an
  105. // array index of the "TBlackjack::ppVBXCard[]" array in "Card::pVBXCard"
  106. // data member.
  107. // The VBX card at this index( in "TBlackjack::ppVBXCard[]" array)
  108. // is used to display that particular "Card" object.
  109. // This keeps the engine and UI part seperate.
  110.  
  111. // Dealer is assumed to have infinite amount of money.
  112.  
  113. // The cards in a particular suit are numbered from 0 - 12
  114. // eg: Ace->0, Two->1..., Jack->10, King->11, Queen->12
  115. // These numbers have nothing to do with the actual blackjack
  116. // points, it is used only to keep track of the cards.
  117.